﻿#pragma once
#include <QObject>


#define MG ManGlobal::instance()
#define mLogIns MG->mLog
#define mTotle mLogIns->reset(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).total
#define mDebug mLogIns->reset(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).debug
#define mInfo mLogIns->reset(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).info
#define mWarning mLogIns->reset(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).warning
#define mError mLogIns->reset(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).error
#define mFatal mLogIns->reset(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).fatal
class ManDB;
class ManPlugin;
class ManModels;
class ManCloud;
class ManSignals;
class LoggerProxy;
class GateWay;
class ManGlobal : public QObject

{
    Q_OBJECT
public:
    explicit ManGlobal(QObject* parent = nullptr);
    ~ManGlobal();
    static ManGlobal* instance();
    void              init(int argc, char* argv[]);

public:
    ManDB*       mDb     = nullptr;
    ManPlugin*   mPlugin = nullptr;
    ManModels*   mModels = nullptr;
    ManCloud*    mCloud  = nullptr;
    ManSignals*  mSignal = nullptr;
    LoggerProxy* mLog    = nullptr;
    GateWay*     mGate   = nullptr;
};
